home *** CD-ROM | disk | FTP | other *** search
- #define B_OPEN 0
- #define B_CLOSE 1
- #define B_INSERT 2
- #define B_ADD 2
- #define B_UPDATE 3
- #define B_DELETE 4
- #define B_EQ 5
- #define B_NEXT 6
- #define B_PREV 7
- #define B_GT 8
- #define B_GE 9
- #define B_LT 10
- #define B_LE 11
- #define B_LOW 12
- #define B_HIGH 13
- #define B_CREATE 14
- #define B_STAT 15
- #define B_EXTEND 16
- #define B_SETDIR 17
- #define B_GETDIR 18
- #define B_BEGTRANS 19
- #define B_ENDTRANS 20
- #define B_ABORTTRANS 21
- #define B_GETPOS 22
- #define B_GETDIRECT 23
- #define B_STEP 24
- #define B_STOP 25
- #define B_VERSION 26
- #define B_UNLOCK 27
- #define B_RESET 28
- #define B_SETOWNER 29
- #define B_CLEAROWNER 30
- #define B_EQ_KEY 55
- #define B_NEXT_KEY 56
- #define B_PREV_KEY 57
- #define B_GT_KEY 58
- #define B_GE_KEY 59
- #define B_LT_KEY 60
- #define B_LE_KEY 61
- #define B_LOW_KEY 62
- #define B_HIGH_KEY 63
- #define B_LOCK_WAIT 100
- #define B_LOCK_NOWAIT 200
-
- #define b_open B_OPEN
- #define b_close B_CLOSE
- #define b_insert B_INSERT
- #define b_update B_UPDATE
- #define b_delete B_DELETE
- #define b_eq B_EQ
- #define b_next B_NEXT
- #define b_prev B_PREV
- #define b_gt B_GT
- #define b_ge B_GE
- #define b_lt B_LT
- #define b_le B_LE
- #define b_low B_LOW
- #define b_high B_HIGH
- #define b_create B_CREATE
- #define b_stat B_STAT
- #define b_extend B_EXTEND
- #define b_setdir B_SETDIR
- #define b_getdir B_GETDIR
- #define b_begtrans B_BEGTRANS
- #define b_endtrans B_ENDTRANS
- #define b_aborttrans B_ABORTTRANS
- #define b_getpos B_GETPOS
- #define b_getdirect B_GETDIRECT
- #define b_step B_STEP
- #define b_stop B_STOP
- #define b_version B_VERSION
- #define b_unlock B_UNLOCK
- #define b_reset B_RESET
- #define b_setowner B_SETOWNER
- #define b_clearowner B_CLEAROWNER
- #define b_eq_key B_EQ_KEY
- #define b_next_key B_NEXT_KEY
- #define b_prev_key B_PREV_KEY
- #define b_gt_key B_GT_KEY
- #define b_ge_key B_GE_KEY
- #define b_lt_key B_LT_KEY
- #define b_le_key B_LE_KEY
- #define b_low_key B_LOW_KEY
- #define b_high_key B_HIGH_KEY
-
- /* Key Flag Definitions */
- #define DUPLICATE 1
- #define MODIFIABLE 2
- #define BINARY 4
- #define NULL_VALUE 8
- #define SEGMENTED 16
- #define ALT_COL_SEQ 32
- #define DESCENDING 64
- #define SUPPLEMENTAL 128
- #define EXTENDED 256
- #define CHECK_FLAGS 11 /* DUPLICATE | MODIFIABLE | NULL_VALUE */
-
- /* Extended Key Types */
- #define B_STRING 0
- #define B_INTEGER 1
- #define B_FLOAT 2
- #define B_DATE 3
- #define B_TIME 4
- #define B_DECIMAL 5
- #define B_MONEY 6
- #define B_LOGICAL 7
- #define B_NUMERIC 8
- #define B_BFLOAT 9
- #define B_LSTRING 10
- #define B_ZSTRING 11
- #define B_UNS_BINARY 14
-
- /* OPEN MODES */
- #define B_NORMAL 0
- #define B_ACCELERATED -1
- #define B_READONLY -2
- #define B_VERIFY -3
-
-
- /* Used in STATBUF for File Flags */
- #define VAR_LEN 1
- #define BLANK_COMP 2
- #define PREALLOCATE 4
-
- #define ERR_INVALOP 1
- #define ERR_IO 2
- #define ERR_NOOPEN 3
- #define ERR_KEYNOTFOUND 4
- #define ERR_DUPLICATE 5
- #define ERR_INVALKEYNUM 6
- #define ERR_DIFFKEYNUM 7
- #define ERR_INVALPOSITION 8
- #define ERR_EOF 9
- #define ERR_MODIFIABLE 10
- #define ERR_INVALFILENAME 11
- #define ERR_FILENOTFOUND 12
- #define ERR_EXTENSION 13
- #define ERR_PREOPEN 14
- #define ERR_PREIMAGE 15
- #define ERR_EXPANSION 16
- #define ERR_CLOSE 17
- #define ERR_DISKFULL 18
- #define ERR_UNRECOVERABLE 19
- #define ERR_NORECMANAGER 20
- #define ERR_KEYBUFLEN 21
- #define ERR_RECBUFLEN 22
- #define ERR_POSBLOCK 23
- #define ERR_PAGESIZE 24
- #define ERR_CREATEIO 25
- #define ERR_NUMKEYS 26
- #define ERR_KEYPOS 27
- #define ERR_RECLEN 28
- #define ERR_KEYLEN 29
- #define ERR_NOTBTRFILE 30
- #define ERR_EXTEND 31
- #define ERR_EXTENDIO 32
- #define ERR_EXTENDNAME 34
- #define ERR_DIRECTORY 35
- #define ERR_TRANSACTION 36
- #define ERR_BEGTRANS 37
- #define ERR_TRANSCONTROL 38
- #define ERR_ENDABORT 39
- #define ERR_TRANSACTMAX 40
- #define ERR_TRANSOPENCLOS 41
- #define ERR_ACCELACCESS 42
- #define ERR_INVALRECADD 43
- #define ERR_NULLKEYPATH 44
- #define ERR_KEYFLAGS 45
- #define ERR_ACCESSDENIED 46
- #define ERR_MAXOPENFILES 47
- #define ERR_ALTCOLSEQ 48
- #define ERR_KEYTYPE 49
- #define ERR_OWNERSET 50
- #define ERR_INVALIDOWNER 51
- #define ERR_WRITINGCAHCE 52
- #define ERR_INVINTERFACE 53
- #define ERR_CONFLICT 80
- #define ERR_LOCKFULL 81
- #define ERR_LOSTPOSITION 82
- #define ERR_OUTSIDETRANS 83
- #define ERR_RECORDINUSE 84
- #define ERR_FILEINUSE 85
- #define ERR_FILEFULL 86
- #define ERR_HANDLEFULL 87
- #define ERR_MODE 88
- #define ERR_NAME 89
- #define ERR_DEVICEFULL 90
- #define ERR_SERVER 91
- #define ERR_TRANSFULL 92
- #define ERR_DEMO24 99
-
- #define TRUE 1
- #define FALSE 0
- #define ALL_FILES NULL
-
- #define NUM_RECS 1
- #define REC_LEN 2
- #define PG_SIZE 3
- #define INDEXES 4
- #define FLAGS 5
- #define ALL 6
-
- typedef struct {
- int key_pos;
- int key_len;
- int key_flags;
- long num_keys;
- unsigned char ext_key_type;
- unsigned char null_value;
- char reserved[4];
- } BTRSEGMENT;
-
- typedef struct
- {
- int reclen;
- int pgsize;
- int numind;
- long numrecs;
- int fileflags;
- char res[4];
- BTRSEGMENT segment[24];
- char altcolseq[265];
- int buf_len;
- } STATBUF;
-
- typedef struct {
- int btr_major;
- int btr_minor;
- char net;
- int lib_major;
- int lib_minor;
- } BTR_VERSION;
-
- typedef struct {
- int errnum;
- char descrip[40];
- } ERROR_MSG;
-
- /* Function Prototypes */
- int BADD(char *,void *);
- int BCHANGEINDEX(char *,int);
- int BCLEAROWNER(char *filename);
- int BCLOSE(char *);
- int BCREATE(char *, STATBUF *);
- int BDELETE(char *);
- int BFILEINFO(char *,int,void *);
- int BGET(int,char *,int,void *,void *);
- int BGETDIRECT(char *,void *,void *);
- int BGETDIRECTORY(int drive,char *path);
- int BGETPOSITION(char *,void *);
- int BSETOWNER(char *filename, char *owner,int access);
- int BSTART(void);
- int BSETDIRECTORY(char *path);
- void BTR_ERROR(int, char *);
- int BTRANS(int);
- int BTRV(int,char *,void *,int *,char *,int);
- int BUNLOCK(char *);
- int BUPDATE(char *,void *);
- int BXTR(int,char *,int,char *,char *);
- int BZAP(char *);
- int GET_FILE_NUM(char *);
- int GET_ERR_MSG(int);
-